// app.js
// const miniShopPlugin = requirePlugin('mini-shop-plugin');
App({
   onLaunch() {
    //   miniShopPlugin.initApp(this, wx);
    },
	editTabBar: function() {
		var _curPageArr = getCurrentPages();
		var _curPage = _curPageArr[_curPageArr.length - 1];
		// console.log(_curPage)
		var _pagePath = _curPage.__route__;
		if (_pagePath.indexOf('/') != 0) {
			_pagePath = '/' + _pagePath;
		}
		console.log(_pagePath)
		var tabBar = this.globalData.tabBar;
		for (var i = 0; i < tabBar.foot_navs.length; i++) {
			tabBar.foot_navs[i].active = false;
			// console.log(tabBar.foot_navs[i].mp_page)
			if (tabBar.foot_navs[i].mp_page == _pagePath) {
                console.log(tabBar.foot_navs[i].active);
				tabBar.foot_navs[i].active = true; //根据页面地址设置当前页面状态    
			}
        }
        console.log(tabBar);
		_curPage.setData({
			tabBar: tabBar
		});
	},
	globalData: {
		userInfo: null,
		tabBar: {}
	}
})
